
<include file="Public:header" />
<include file="Public:menu" />
<div  id="main_content_wrap" class="container_12">
  <div class="container_12 boxbody">
    <h2>
      分销设置
    </h2>
    <foreach name="setting" item="item">
    <form action="{:U('Set/done')}" method="post" id="checkAdminForm1"  name="myform" enctype="multipart/form-data">
      <p>
        <label style="width: 150px">一级提成比例：</label>
        <input text="text" name="scale_one" class="text1 small" value="{$item.scale_one}" maxlength="3" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')">
        <font style="font-size: 16px;line-height: 45px">%</font>
      </p>
      <p>
        <label style="width: 150px">二级提成比例：</label>
        <input text="text" name="scale_two" class="text1 small" value="{$item.scale_two}" maxlength="3" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')">
        <font style="font-size: 16px;line-height: 45px">%</font>
      </p>
      <p>
        <label style="width: 150px">冻结开关：</label>
        <if condition="$action eq 0 ">
          <span style="line-height: 50px">
            <font style="font-weight: bold">开：</font><input type="radio" value="0" name="switch" checked="checked"  />
            <font style="font-weight: bold">关：</font><input type="radio" value="1" name="switch" /></span>
        <else />
           <span style="line-height: 50px">
        <font style="font-weight: bold">开：</font><input type="radio" value="0" name="switch"   />
        <font style="font-weight: bold">关：</font><input type="radio" value="1" name="switch" checked="checked" /></span>
        </if>
      </p>

      <p class='tac'>
        <input type="button" class="submit" value="保存" onclick="checkthis_sub()" />
      </p>
    </form>
    </foreach>
  </div>
  <div class="clearfix" >&nbsp;</div>
  <!-- END TABULAR DATA EXAMPLE -->
  <include file="Public:footer" />
</div>
<script>
  function checkthis_sub() {
    var scaleone = document.myform.scale_one.value;
    var scaletwo = document.myform.scale_two.value;
    if (parseFloat(scaletwo) > parseFloat(scaleone)) {
      alert('注意：二级分成不能大于一级分成');
    }
    else {
      document.myform.submit();//button按钮实现提交 方法
    }
  }
</script>